home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-03 / qbasicpg.zip / COMPARE.BAS < prev    next >
BASIC Source File  |  1989-08-31  |  719b  |  23 lines

  1. ' COMPARE.BAS
  2. ' This program compares any two characters.
  3.  
  4. CLS
  5.  
  6. INPUT "Enter any character:  ", firstChar$
  7. INPUT "Enter another character:  ", secondChar$
  8. PRINT
  9.  
  10. SELECT CASE ASC(firstChar$) - ASC(secondChar$)
  11.     CASE IS < 0
  12.         PRINT "'"; firstChar$; "' comes before '"; secondChar$; "'"
  13.         PRINT "because"; ASC(firstChar$); "is less than"; ASC(secondChar$)
  14.     CASE IS > 0
  15.         PRINT "'"; firstChar$; "' comes after '"; secondChar$; "'"
  16.         PRINT "because"; ASC(firstChar$); "is more than"; ASC(secondChar$)
  17.     CASE ELSE
  18.         PRINT "'"; firstChar$; "' is the same as '"; secondChar$; "'"
  19.         PRINT "because"; ASC(firstChar$); "is equal to"; ASC(secondChar$)
  20. END SELECT
  21.  
  22.  
  23.